/**
数组使用
*/
package main

import "fmt"

func main() {

	var arr [10]int                               //定义[0 0 0 0 0 0 0 0 0 0]
	var arr1 = [10]int{1, 2, 3, 1, 2, 3, 2, 1, 2} //定义并赋值

	fmt.Println(arr)
	fmt.Println(arr1)
	fmt.Println(arr[2])
	fmt.Println(len(arr))

	for i:=0;i<len(arr);i++ {
		fmt.Println(arr1[i])
	}

	for i, v := range arr1 {//range returns both the index and value
		fmt.Printf("%d the element of a is %.2f\n", i, v)
	}

}
